package com.zk.fm.ui;

import java.util.ArrayList;
import java.util.List;

import android.app.TabActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TabHost;

import com.zk.fm.R;

public class LeagueActivity extends TabActivity {

	private TabHost myTabhost;
	private ListView scoreboardList;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		initView();
		bindData();
	}

	private void bindData() {
		int select = getIntent().getExtras().getInt("league");
		System.out.println("select = " + select);

		switch (select) {
		case 0:
			List<String> data = new ArrayList<String>();
			scoreboardList.setAdapter(new ArrayAdapter<String>(this,
					android.R.layout.simple_list_item_1, data));
			break;
		default:
			break;
		}

	}

	private void initView() {
		myTabhost = this.getTabHost();
		View v = LayoutInflater.from(this).inflate(R.layout.league,
				myTabhost.getTabContentView(), true);
		// myTabhost.setBackgroundColor(Color.argb(150, 22, 70, 150));
		myTabhost.addTab(myTabhost.newTabSpec("One")
				.setIndicator(getString(R.string.scoreboard), null)
				.setContent(R.id.widget_layout_scoreboard));
		myTabhost.addTab(myTabhost.newTabSpec("Two")
				.setIndicator(getString(R.string.Scorer), null)
				.setContent(R.id.widget_layout_Scorer));
		myTabhost.addTab(myTabhost.newTabSpec("Three")
				.setIndicator(getString(R.string.news), null)
				.setContent(R.id.widget_layout_news));

		scoreboardList = (ListView) v.findViewById(R.id.scoreboardlist);
	}
}
